'use strict';

module.exports = [
    [ '', 'home/index/index', 'get' ],
    [ '/index', 'home/index/index', 'get' ],
    [ '/index/:order', 'home/index/index', 'get' ],
    [ '/admin', 'admin/index/index', 'get' ],
    [ '/p/:id', 'home/detail/index', 'get' ],
    [ '/dlink/:id', 'home/detail/downloadgetid', 'get' ],
    [ '/u/avatar', 'center/index/avatar', 'get' ],
    [ '/u/avatar/:uid', 'center/index/avatar', 'get' ],
    [ '/search', 'home/search/index', 'get' ],
    [ '/topic', 'home/keyword/index', 'get' ],
    [ '/topic/:key', 'home/keyword/index', 'get' ],
    [ '/t/:key', 'home/keyword/list', 'get' ],
    [ '/admin/mod/:cate_id', 'cmswing/modadminbase/index', 'get' ],
    [ '/q/:id', 'mod/question/index/detail', 'get' ],
    [ /\/api\/(\w+)(?:\/(\d+))?/, 'api/:1?id=:2', 'rest' ],

    /** 支付插件 */
    [ '/center/pay/pay', 'ext/pay/index/payment?type=0', 'get' ], // 获取支付方式 购物
    [ '/center/account/recharge', 'ext/pay/index/payment?type=1', 'get,post' ], // 获取支付方式 充值
    [ /^\/pay\/(\d+)\/(\d+)/, 'ext/pay/index/pay?order=:1&payment=:2', 'get' ], // 调用支付接口
    [ '/pay/alipay/result', 'ext/pay/index/result?payType=alipay', 'get' ], // 支付同步结果
    [ '/pay/alipay/notify', 'ext/pay/index/notify?payType=alipay', 'post' ], // 支付异步结果
    [ '/pay/deduction/result', 'ext/pay/index/result?payType=deduction', 'get' ], // 支付扣款结果

    [ /(^(?!\/admin|\/home\/|\/center\/|\/api\/|\/mod\/|\/ext\/).*)$/, 'cmswing/route/index?category=:1', 'get' ],
];
